package com.demo5.component;

import com.demo5.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {

    @Bean
    public Student student1() {
        Student student = new Student();
        student.setId(1);
        student.setName("周杰伦");
        return student;
    }

    @Bean
    public Student student2() {
        Student student = new Student();
        student.setId(2);
        student.setName("林俊杰");
        return student;
    }

}
